RESOURCES


	McAsm has the capability of assembling resource 
definitions. Resource definitions are identified by a two-
character resource delimiter at the start of a source line. 
The delimiter sequence $$ starts a standard resource 
definition. A standard resource definition is a definition of a 
resource type that McAsm knows how to interpret. The 
delimiter sequence [[ starts a user defined resource 
definition. A user defined resource definition is a definition 
of a resource type that McAsm doesn't know how to interpret. 
The delimiter sequence ]] ends a user defined resource 
definition. (Standard resource definitions don't require an 
ending delimiter because McAsm knows where the resource 
definition ends from information you supply in the definition.)


	The formats of the two types of definitions are as 
follows:


	$$ TYPE, ID, ATTR, NAME [<tab>] [;] [comment]

	<item list>


	or


	[[ TYPE, ID, ATTR, NAME [<tab>] [;] [comment]

	<code and/or data>

	]]



	TYPE is a four-character resource type. For 
standard definitions, it must be one of the types that McAsm 
recognizes. For a user defined definition, it can be any four 
characters. (If less than four characters are specified, then the 
specified characters are left-justified in a 32-bit longword 
and space padded on the right.) ID is the resource ID. It is 
interpreted as a numeric expression. ATTR specifies the 
attribute byte for the resource and is also interpreted as a 
numeric expression. NAME is the name of the resource and is 
interpreted as a string. ATTR and NAME are optional 
parameters and may be omitted. (Although you can't omit the 
ATTR if you want to specify a NAME.) Here are two examples 
for a standard resource, one with all parameters specified, and 
one with ATTR and NAME omitted:


	$$ ALRT, 2, 0, alert no. 2


	$$ WIND, 1



	The item list is simply a list of items that make 
up the resource definition. Each item in the list is interpreted 
by McAsm in a certain way. The types of items you specify in 
the list must correspond exactly with the types of items that 
McAsm expects for that resource. If you specify an item of the 
wrong type or if you specify too many or too few items, you'll 
get syntax errors (gobs of them) on subsequent lines of the file.


	Items in the item list appear at the beginning of 
subsequent source lines after the line containing the $$. The 
format of lines in the item list is as follows:


	item [, item, ...] [<tab>] [;] [comment]

	item [, item, ...] [<tab>] [;] [comment]

	etc... for as many lines as it takes to specify 
all items


As you can see, you have your choice of entering each item on 
its own source line or of placing several items on one line or 
any combination of either one. A tab or ; in the line causes 
McAsm to ignore all subsequent characters on the line and skip 
to the start of the next line for the next item in the list.


	There are several types of items. The type of each 
item is marked in the descriptions of the formats for each 
standard resource. The types have the following meanings:


	bexp	an expression interpreted as a byte

	wexp	an expression interpreted as a word

	lexp	an expression interpreted as a long

	chrl	a four-character long

	str	a string


	bexp, wexp, and lexp items are simply numeric 
expressions and can be any allowable McAsm expression. In 
most cases, you don't have to worry about what size the 
expression is. In some cases you do though, particularly in the 
bit maps ,which McAsm interprets as a sequence of longwords.


	chrl items are entered as a sequence of from one to 
four characters. If less than four characters are specified, then 
the item will be left justified in a 32-bit long and padded on 
the right with spaces. Do not enclose the characters in 
quotation marks.



	You may enter strings in either of two ways. First, 
you can just type the string. This is fine if your string doesn't 
contain any special characters or leading spaces. If it does 
contain special characters or leading spaces, then you have to 
enclose the string in quotation marks as "string".  (Any of the 
escape sequences allowed in TEXT strings are allowed in 
string.) If your string isn't enclosed in quotation marks, then 
you can continue the string to the start of the next line by 
ending the string with a backslash \ character. (Strings 
enclosed in quotes can't be continued to the next line.) You can 
specify a null string (a string with a length of zero) with the 
vertical bar |.


	The code and/or data in a user-defined resource may 
be any combination of allowable McAsm instruction opcodes or 
pseudo-ops. The definition must be ended with the ]] delimiter 
or you'll get an error message.


STANDARD RESOURCE FORMATS


	Here are the standard resource types recognized by 
McAsm and the formats of the item lists for each.


	Note that each item in these formats is placed on its 
own source line but that doesn't have to be the case. They're 
only shown that way here for clarity.


	The file LIST.ASM (or LISTER.LST on CompuServe) 
contains examples of the usage of many of these formats.


	(Also, be aware that the formats described here are 
not the exact formats of the resources as they are stored in the 
resource file. McAsm does some interpretation of the formats 
and stores things in the resource file according to the 
information you specify in the item lists. For example, when 
you have to specify the number of items in a list, that number 
may or may not actually be stored in the resource file, 
depending on the format of the actual resource. In many cases, 
such a number is only used to tell McAsm how many items in 
the list there are to interpret. Also, in certain cases, McAsm 
will add required items to the resource file that it knows are 
needed and which it figures out from the delimiter line or the 
item list.)




**************************************************


$$ ALRT,ID,ATTR,NAME

TOP	wexp	bounds rectangle:

LEFT	wexp

BOTTOM	wexp

RIGHT	wexp

DITL_LIST_ID	wexp	resc ID of item list

STAGES	wexp	see DLOG Mgr, IM, page 35


**************************************************


$$ BNDL,ID,ATTR,NAME

SIGNATURE	chrl	application's signature

VERS_DATA_RESC_ID	wexp	0 by convention

NO_RESC_TYPES	wexp	no. of BNDL resc types that 
follow:


For each resc type:

RESOURCE_TYPE	chrl	typically ICN# or FREF

NO_MAPPINGS_THIS_TYPE	wexp	no. of mappings that follow:


For each mapping:

LOCAL_ID	wexp

ACTUAL_ID	wexp



** Note: If you use the standard BNDL resource in a file, then 
McLInk will

automatically set the bundle bit in the output file after the 
link is completed.


**************************************************


$$ CNTL,ID,ATTR,NAME

TOP	wexp	bounds rectangle:

LEFT	wexp

BOTTOM	wexp

RIGHT	wexp

INITIAL_VALUE	wexp	current value of control

VISIBLE	wexp	boolean

MAX_VALUE	wexp	maximum value of control

MIN_VALUE	wexp	minimum value of control

CTRL_DEFINITION_ID	wexp	resc ID of the definition 
function for

		   the control type:

			0  simple button

			1  check box

			2  radio button

			8  add to above to use 
window's

			       font

			16 scroll bar

REFCON	lexp	user defined value

TITLE	str	the control's title


**************************************************


$$ CURS,ID,ATTR,NAME

CURSOR_DATA_BYTES	lexp	eight longs of cursor image:

   "	lexp

   " 	lexp

   " 	lexp

   " 	lexp

   " 	lexp

   " 	lexp

   " 	lexp

CURSOR_MASK_BYTES	lexp	eight longs of xursor mask:

   " 	lexp

   " 	lexp

   " 	lexp

   " 	lexp

   " 	lexp

   " 	lexp

   " 	lexp

H_OF_HOT_SPOT	wexp	horizontal of the hot spot

V_OF_HOT_SPOT	wexp	vertical of the hot spot


**************************************************


$$ DITL,ID,ATTR,NAME

NO_ITEMS_IN_LIST	wexp	no. of items in this list:


For each item in the list:

HANDLE_HOLDER	lexp	placeholder for handle or 
pointer -

			normally 0

TOP	wexp	display rectangle (local 
coordinates):

LEFT	wexp

BOTTOM	wexp

RIGHT	wexp

ITEM_TYPE	bexp	type of the item:

			0   user defined (dialog 
only)

			4   std button control

			5   std check box 
control

			6   std radio button 
control

			7   defined in CTRL 
template

			8   static text

			16  editable text 
(dialog only)

			32  icon

			64  QuickDraw picture

			128 add to any of above 
to disable

ITEM	----	the actual item; contents of 
this field

			depend on item type as 
follows:

If item type is, then content is:

   4,5,6	str	control title

   7	wexp	resc ID of template

   8,16	str	the text

   32,64	wexp	resc ID of ICON or PICT

   0	nil	empty (length = 0)



**************************************************


$$ DLOG,ID,ATTR,NAME

TOP	wexp	bounds rectangle:

LEFT	wexp

BOTTOM	wexp

RIGHT	wexp

WINDOW_DEFINITION_ID	wexp	the type of window:

			0  std doc wind or 
modeless dialog

			       box

			1  alert box or modal 
dialog box

			2  plain box

			3  plain box with 
shadow

			4  doc window without 
size box

			16 rounded corner 
window

VISIBLE	wexp	boolean, initial state of 
dialog

GOAWAY	wexp	boolean, TRUE means window 
has a

		    close box

REFCON	lexp	user defined value

RESC_ID_OF_ITEM_LIST	wexp	resc ID of the DITL for this 
dialog

TITLE	str	the dialog's title (0 length 
string if

			modal dialog box)


**************************************************


$$ FREF,ID,ATTR,NAME

FILETYPE	chrl	typically APPL

LOCAL_ID_FOR_ICON_LIST	wexp

FILENAME	str	filename that should follow 
the file

		    to a new disk (null string 
if none) 


**************************************************


$$ ICON,ID,ATTR,NAME

(32) ICON_BYTE_LONGS	lexp	icon bit map - 32 longs:

...

...



**************************************************


$$ ICN#,ID,ATTR,NAME

(32) ICON1_BYTE_LONGS	lexp	icon bit map - 32 longs:

...

...

(32) ICON2_BYTE_LONGS	lexp	icon bit map mask - 32 
longs:

...

...


**************************************************


$$ MENU,ID,ATTR,NAME

WIDTH_HOLDER	wexp	0 - placeholder for menu 
width

HEIGHT_HOLDER	wexp	0 - placeholder for menu 
height

STD_MENU_PROC_HOLDER	lexp	normally 0

ENABLE_MASK	lexp	bit 0 set if menu enabled,

		  bit 1 set if menu item 1 
enabled,

		  bit 2 set if menu item 2 
enabled,

		  etc...

MENU_TITLE	str	the menu's title

NUMBER_MENU_ITEMS	wexp	number of items in the menu:


For each menu item:

MENU_ITEM	str	the text of the item

ICON_NUMBER	bexp	0 = none, ICON'S resc ID =

			        ICON number + 256

KEYBD_EQUIV	bexp	equivalent kybd char code, 0 
= none

MARKING_CHAR	bexp	marking char code, 0 = no 
mark

TEXT_STYLE	bexp	text style of the item:

			bit 0 = bold

			bit 1 = italic

			bit 2 = underline

			bit 3 = outline

			bit 4 = shadow

			bit 5 = condense

			bit 6 = extend



**************************************************


$$ PAT ,ID,ATTR,NAME

PATTERN_BYTES	lexp	two longs:

   "	lexp


**************************************************


$$ PAT#,ID,ATTR,NAME

NO_OF_PATTERNS	wexp	the number of patterns in 
the list:


For each pattern:

PATTERN_BYTES	lexp	two longs

   "	lexp


**************************************************


$$ STR ,ID,ATTR,NAME

STRING	str


**************************************************


$$ STR#,ID,ATTR,NAME

NO_OF_STRINGS	wexp	the number of strings in the 
list:


For each string:

STRING	lexp



**************************************************


$$ WIND,ID,ATTR,NAME

TOP	wexp	bounds rectangle:

LEFT	wexp

BOTTOM	wexp

RIGHT	wexp

WINDOW_DEFINITION_ID	wexp	window type:

			0  std doc window or 
modeless

			         dialog box

			1  alert box or modal 
dialog box

			2  plain box

			3  plain box with 
shadow

			4  doc window without 
size box

			16 rounded corner 
window

VISIBLE	wexp	boolean, initial state of 
window

GOAWAY	wexp	boolean, TRUE means window 
has a REFCON	lexp	user defined value

TITLE	str	the window's title


**************************************************


[[ XXXX,ID,ATTR,NAME		user defined resource

<DATA/CODE>		whatever you want

...

]]		don't forget the ender!


**************************************************

